package com.esunny.resourcevisualization.service.impl;

import com.esunny.resourcevisualization.domain.entity.ResourceCacheInfo;
import com.esunny.resourcevisualization.domain.response.ReturnStructure;
import com.esunny.resourcevisualization.manage.ResourceCacheInfoManage;
import com.esunny.resourcevisualization.service.ResourceCacheInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @version 1.0.0.0
 * @ClassName ResourceCacheInfoServiceImpl
 * @Description 资源实体缓存信息逻辑处理实现
 * @Author baochencong
 * @Date 2020/11/26 16:29
 */
@Service
public class ResourceCacheInfoServiceImpl implements ResourceCacheInfoService {

    @Resource
    private ResourceCacheInfoManage resourceCacheInfoManage;

    @Override
    public ReturnStructure remarkResourceDealt(int cacheResourceId) {
        boolean success = resourceCacheInfoManage.remarkResourceDealt(cacheResourceId);
        return success ? ReturnStructure.SUCCESS("修改处理状态成功",null):ReturnStructure.SUCCESS("修改处理状态失败",null);
    }

    @Override
    public ResourceCacheInfo getResourceCacheInfoById(int cacheResourceId) {
        return resourceCacheInfoManage.getResourceCacheInfoById(cacheResourceId);
    }

}
